﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<title>小窝社区</title>


		<th:block th:replace="~{/frontdesk/resources::common_css}"/>
		<th:block th:replace="~{/frontdesk/resources::common_js}"/>

	</head>
	<body data-spy="scroll" data-target="blog-detail-2.htmlscrollspy">

	<!-- THE LOADER -->
	
	<div class="be-loader">
	    	<div class="spinner">
				<div class="spinner-container container1">
			    <div class="circle1"></div>
			    <div class="circle2"></div>
			    <div class="circle3"></div>
			    <div class="circle4"></div>
				</div>
			  	<div class="spinner-container container2">
			    <div class="circle1"></div>
			    <div class="circle2"></div>
			    <div class="circle3"></div>
			    <div class="circle4"></div>
			  	</div>
			  	<div class="spinner-container container3">
			    <div class="circle1"></div>
			    <div class="circle2"></div>
			    <div class="circle3"></div>
			    <div class="circle4"></div>
  				</div>
			</div>
	    </div>
	<!-- THE HEADER -->
	<header th:replace="~{/frontdesk/header::header}"></header>


	<!-- MAIN CONTENT -->
	<div id="content-block">
		<div class="container be-detail-container">
			<div class="row">
				<div class="col-xs-12 col-md-3 left-feild">
					<div class="be-vidget back-block">
						<a class="btn full color-1 size-1 hover-1"><i class="fa fa-chevron-left"></i>返回个人主页</a>
					</div>


				</div>
				<div class="col-xs-12 col-md-9 _editor-content_">
					<div class="affix-block" id="basic-information">
						<div class="be-large-post">
							<div class="info-block style-2">
								<div class="be-large-post-align"><h3 class="info-block-label">修改信息</h3></div>
							</div>
							<div class="be-large-post-align">
								<div class="be-change-ava">

									<a class="be-ava-user style-2">
										<img id="pImage" th:src="${session.member.profilePicture}" alt="">
									</a>
									<div class="form-label">更换头像</div>
									<!--                           提交图片必须加上enctype="multipart/form-data"这个属性-->
									<form class="btn color-4 size-2 hover-7" id="uploadPImage" enctype="multipart/form-data">
										<input  type="file"  name="file" id="pImageFile">
									</form>

								</div>
								<script th:inline="javascript">
									$(function (){
										$("#pImageFile").change(function (){
											// 异步提交表单
											$("#uploadPImage").ajaxSubmit({
												url:"/frontdesk/member/upload",
												type: "post",
												success:function (result){
													// 上传成功后，图片回显到pImage上
													$("#pImage").attr("src",result.data[0]);
													//上传成功后，图片地址放入产品表单的隐藏域中
													$("#hiddenPImage").val(result.data[0]);
												}
											})
										})
									})
								</script>
							</div>
							<div class="be-large-post-align">
								<div class="row">
									<form th:action="@{/frontdesk/member/update}" method="post">
										<input type="hidden" name="mid" id="mid" th:value="${session.member.mid}">
										<input type="hidden" name="sex" id="sex" th:value="${session.member.sex}">
										<input type="hidden" name="active" id="active" th:value="${session.member.active}">
										<input type="hidden" name="activeCode" id="activeCode" th:value="${session.member.activeCode}">
										<input type="hidden" name="uid" id="uid" th:value="${session.member.uid}">
										<input type="hidden" name="blackHome" id="blackHome" th:value="${session.member.blackHome}">
										<input type="hidden" name="profilePicture" id="hiddenPImage" th:value="${session.member.profilePicture}">
										<div class="input-col col-xs-12 col-sm-6">
											<div class="form-group fg_icon focus-2">
												<div class="form-label">用户名</div>
												<input class="form-input" name="username" type="text" th:value="${session.member.username}" >
											</div>
										</div>
										<div class="input-col col-xs-12">
											<div class="form-group focus-2">
												<div class="form-label">密码</div>
												<input class="form-input" name="password"  type="password" th:value="${session.member.password}">
											</div>
										</div>
										<div class="input-col col-xs-12">
											<div class="form-group focus-2">
												<div class="form-label">邮箱</div>
												<input name="email" class="form-input" type="email" th:value="${session.member.email}">
											</div>
										</div>
										<div class="input-col col-xs-12">
											<div class="form-group focus-2">
												<div class="form-label">个人简介</div>
												<input name="personalMessage" class="form-input" type="text" th:value="${session.member.personalMessage}">
											</div>
										</div>
										<div class="col-xs-12">
											<input type="submit" class="btn color-1 size-2 hover-1 btn-right" value="点击修改">
										</div>
									</form>

								</div>
							</div>
						</div>
					</div>
				</div>				
			</div>
		</div>
	</div>

	<!-- THE FOOTER -->
	<footer th:replace="~{/frontdesk/footer::footer}"></footer>

	<div class="be-fixed-filter"></div>

	<footer th:replace="~{/frontdesk/login::login}"></footer>
	<footer th:replace="~{/frontdesk/register::register}"></footer>


	</body>
</html>